package acm.天梯赛练习2;
import java.util.Scanner;

public class G {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[] sn=new int[1000+1];
        for (int i = 2; i < sn.length; i++) {
            int sum = 0;
            for (int j = 1; j < i; j++) {
                if (i % j == 0) {
                    sum += j;
                }
                sn[i]=sum;
            }
        }
        int t = input.nextInt();
        while (t-- > 0) {
            int n = input.nextInt();
            int sum = 0;
            int i=2;
            while (sn.length>i&&sn[i]!=n){
                i++;
            }
            System.out.println(sn.length>i?"no":"yes");
        }
    }
}
